<?php

/*
Admin Custom Designs (admin_customize.php)
*/

$page_title = "Customize Design";
$rank_check = 7;

include "../header.inc.php";

if ($page == "add")
{
	mysql_query("DELETE FROM custom_designs WHERE game = '$game'");
	mysql_query("INSERT INTO custom_designs VALUES ('', '$game', '$skin_openhtml', '$skin_closehtml', '$skin_tableborder', '$skin_top_cell_color', '$skin_top_cell_text', '$skin_middle_cell_color', '$skin_middle_cell_text', '$skin_really_light', '$skin_main_text_color', '$skin_main_link_color', '$skin_main_hover_color')");
	
	mysql_query("UPDATE game_tables SET design = 'custom' WHERE id = '$game'");

	die(header("Location: admin_customize.php?game=$game"));
}

print "$openHTML";

$findDesign = fetch("SELECT * FROM custom_designs WHERE game = '$game'");

ECHO <<<END

<FORM ACTION="admin_customize.php?game=$game&page=add" METHOD=POST>

<p>OpenHTML: (<a href=design_codes.php?game=$game target=_blank>View Usable Codes</a>)<Br>
<TEXTAREA NAME="skin_openhtml" ROWS=26 COLS=75 WRAP=virtual>$findDesign[openhtml]</TEXTAREA></p>

<p>CloseHTML: (<a href=design_codes.php?game=$game target=_blank>View Usable Codes</a>)<Br>
<TEXTAREA NAME="skin_closehtml" ROWS=26 COLS=75 WRAP=virtual>$findDesign[closehtml]</TEXTAREA></p>

<p>Table and Text Colors: (<a href=../view_colors.php?game=$game target=_blank>View Color Codes</a>)<Br>
Table Border: <input type=text name=skin_tableborder value="$findDesign[tableborder]"><br>
Darkest Color: <input type=text name=skin_top_cell_color value="$findDesign[top_cell_color]"><br>
Lightest Text Color: <input type=text name=skin_top_cell_text value="$findDesign[top_cell_text]"><br>
Medium Cell Color: <input type=text name=skin_middle_cell_color value="$findDesign[middle_cell_color]"><br>
Medium Text Color: <input type=text name=skin_middle_cell_text value="$findDesign[middle_cell_text]"><br>
Lightest Cell Color: <input type=text name=skin_really_light value="$findDesign[really_light]"><br>
Main Text Color: <input type=text name=skin_main_text_color value="$findDesign[main_text_color]"><br>
Main Link Color: <input type=text name=skin_main_link_color value="$findDesign[main_link_color]"><br>
Main Hovered Link Cover: <input type=text name=skin_main_hover_color value="$findDesign[main_hover_color]">
</p>

<p><input type=submit value="Create Skin"></p>

<p>Notice, by creating this skin you will be deleting the skin you were previously using and there is no way to restore previous custom made skins.</p>

</FORM>

END;

print "$closeHTML";
?>
